package com.ruoyi.system.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 用户勋章对象 user_medal
 * 
 * @author ruoyi
 * @date 2025-04-17
 */
public class UserMedal extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** 勋章ID */
    @Excel(name = "勋章ID")
    private Long medalId;

    /** 勋章名称 */
    @Excel(name = "勋章名称")
    private String medalName;

    /** 勋章描述 */
    @Excel(name = "勋章描述")
    private String description;

    /** 获得时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "获得时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdTime;

    // 新增：从 Medal 表关联获取的勋章图片路径
    private String medalImage;

    // getter/setter
    public String getMedalImage() { return medalImage; }
    public void setMedalImage(String medalImage) { this.medalImage = medalImage; }

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    public void setMedalId(Long medalId) 
    {
        this.medalId = medalId;
    }

    public Long getMedalId() 
    {
        return medalId;
    }

    public void setMedalName(String medalName) 
    {
        this.medalName = medalName;
    }

    public String getMedalName() 
    {
        return medalName;
    }

    public void setDescription(String description) 
    {
        this.description = description;
    }

    public String getDescription() 
    {
        return description;
    }

    public void setCreatedTime(Date createdTime) 
    {
        this.createdTime = createdTime;
    }

    public Date getCreatedTime() 
    {
        return createdTime;
    }
   @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userId", getUserId())
            .append("medalId", getMedalId())
            .append("medalName", getMedalName())
            .append("description", getDescription())
            .append("createdTime", getCreatedTime())
                .append("medalImage", medalImage) // 新增字段
            .toString();
    }
}
